<%@ include file="/html/portlet/ext/registration/init.jsp" %>

<script type="text/javascript">

	function validate() {
	
		var studentId = document.<portlet:namespace />fm.<portlet:namespace />studentId;
		var schoolPin = document.<portlet:namespace />fm.<portlet:namespace />schoolPin;
		
		if(studentId.value.length == 0) {
			alert("Please Enter EmployeeId Id");
			studentId.focus()
			return false;
		}
		
		if(schoolPin.value.length == 0) {
			alert("Please Enter School Pin");
			schoolPin.focus()
			return false;
		}
		
		return true;
	}
</script>

<%					
String studentId = (String)request.getAttribute("studentId");

if(Validator.isNull(studentId)){
	studentId = "";
}
String schoolPin = (String)request.getAttribute("schoolPin");

if(Validator.isNull(schoolPin)){
	schoolPin = "";
}
%>

<portlet:actionURL var="validParentURL">
       <portlet:param name="struts_action" value="/ext/registration/addRegistration" />
       <portlet:param name="<%= Constants.CMD %>" value="validParent" />                
</portlet:actionURL>

<liferay-ui:error exception="<%= SecretPinException.class %>" message="school-pin-not-exist" />
<liferay-ui:error exception="<%= DuplicateRollNoException.class %>" message="duplicate-student-id" />



<form action="<%= validParentURL.toString() %>" method="POST" name="<portlet:namespace />fm">   
<center> 
	<fieldset class="block-labels col">
	<table width='100%' class='portlet-box' align='center' cellspacing="0" cellpadding="2">
		<tr class = "portlet-section-body results-row alt">
			<td>
				<b><liferay-ui:message key="student-id" /></b><font color="red" style = "font-size: medium;">*</font>
			</td>
			<td>
				<input type= "text" name= "<portlet:namespace />studentId" value="<%= ParamUtil.getString(request,"studentId") %>" />
			</td>
		</tr>
		<tr class = "portlet-section-body results-row">
			<td>
				 <b><liferay-ui:message key="school-pin" /></b><font color="red" style = "font-size: medium;">*</font> 
			</td>
			<td>
				<input type= "text" name= "<portlet:namespace />schoolPin"  value="<%= ParamUtil.getString(request,"schoolPin") %>" />
			</td>
		</tr>
		
	</table>  
	<br>
	<table align='center'>
		<tr class="portlet-form-button">
			<td>
				<input type="submit" value="<liferay-ui:message key="continue" />" onClick="return validate()"/>
				<input type="button"  value='<liferay-ui:message key="back" />' onClick='history.go(-1)'>
				<input type="button" value="<liferay-ui:message key="cancel" />"onClick="location.href='<%=themeDisplay.getPathFriendlyURLPublic () +"/guest/registration-blossoms?p_p_id=Registration&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_Registration_struts_action=%2Fext%2Fregistration%2FmanageRegistration&_Registration_cmd=move&registration=1" %>';"/>
			</td>
		</tr>
	</table> 
	</fieldset> 
  </center>
</form>
